using System;
using System.Collections.Generic;
using System.Text;
using PersistenceObject.Framework.Expressions;

namespace PersistenceObject.Framework
{
    public class FieldValue : IFieldValue
    {
        public static FieldValue Create(FieldAdapter field, object value)
        {
            return new FieldValue(field, value);
        }

        public static FieldValue Create(string sql)
        {
            return new FieldValue(sql);
        }

        public static FieldValue Create(string name, object value)
        {
            return new FieldValue(name, value);
        }

        public FieldValue(string sql)
        {
            this.sql = sql;
        }

        public FieldValue(string name, object value)
        {
            this.Name = name;
            this.Value = value;
        }

        public FieldValue(FieldAdapter field, object value)
        {
            this.Name = field.Name;
            this.Value = value;
        }

        public string Name
        {
            get
            {
                return this.name;
            }
            set
            {
                this.name = value;
            }
        }

        public object Value
        {
            get
            {
                return this.value;
            }
            set
            {
                this.value = value;
            }
        }

        private string name;
        private object value;

        private string sql;
        public string Sql
        {
            get { return sql; }
            set { sql = value; }
        }
    }
}
